#
# Makefile
#
# Makefile for fbv

#CONF=Make.conf
#-include $(CONF)

#CROSS	= /home/jqc/Desktop/TOOLCHAIN/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-
CC	= gcc 
CFLAGS  = -O2 -Wall -D_GNU_SOURCE -g
LDFLAGS = -g

SOURCES	= main.c jpeg.c gif.c png.c bmp.c fb_display.c transforms.c image_proc.c led_conf.c log.c
OBJECTS	= ${SOURCES:.c=.o}

OUT	= fbv
#LIBS	= -lgif -ljpeg -lpng
LIBS	= -lungif -ljpeg -lpng

all: $(OUT)
	@echo Build DONE.

$(OUT): $(OBJECTS)
	$(CROSS)$(CC) $(LDFLAGS) -o $(OUT) $(OBJECTS) $(LIBS)

%.o:%.c
	$(CROSS)$(CC) -c -o $@ $<

clean:
	rm -f $(OBJECTS) *~ $$$$~* $(OUT)

distclean: clean
	rm -f $(OUT)

install: $(OUT)
	cp $(OUT) $(DESTDIR)$(bindir)
	gzip -9c $(OUT).1 > $(DESTDIR)$(mandir)/man1/$(OUT).1.gz

uninstall: $(DESTDIR)$(bindir)/$(OUT)
	rm -f $(DESTDIR)$(bindir)/$(OUT)
	rm -f $(DESTDIR)$(mandir)/man1/$(OUT).1.gz
